/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface SoRds extends BasicModel<SoRds> {
  soCode?: string; // 主表ID
  cinvcode?: string; // 存货编码
  cinvname?: string; // 存货名称
  dpredate?: string; // 预发货日期
  iquantity?: number; // 数量
  inum?: number; // 辅计量数量
  iquotedprice?: number; // 报价
  iunitprice?: number; // 原币无税单价
  itaxunitprice?: number; // 原币含税单价
  imoney?: number; // 原币无税金额
  itax?: number; // 原币税额
  isum?: number; // 原币价税合计
  idiscount?: number; // 原币折扣税
  inatunitprice?: number; // 本币无税单价
  inatmoney?: number; // 本币无税金额
  inattax?: number; // 本币税额
  inatsum?: number; // 本币价税合计
  inatdiscount?: number; // 本币折扣额
  ifhnum?: number; // 累计发货辅计量数量
  ifhquantity?: number; // 累计发货数量
  ifhmoney?: number; // 累计原币发货金额
  ikpquantity?: number; // 累计开票数量
  ikpnum?: number; // 累计开票辅计量数量
  ikpmoney?: number; // 累计原币开票金额
  cmemo?: string; // 备注
  kl?: number; // 扣率
  kl2?: number; // 二次扣率
  itaxrate?: number; // 税率
  cunitid?: string; // 计量单位编码
  fpurquan?: number; // 采购数量
  fsalecost?: number; // 零售单价
  fsaleprice?: number; // 零售金额
  cquocode?: string; // 报价单号
  dpremodate?: string; // 预完工日期
  fpursum?: number; // 采购金额
  fpurbillqty?: number; // 采购发票数量
  fpurbillsum?: number; // 采购发票金额
  fveridispqty?: number; // 已审核订货数量
  fveridispsum?: number; // 已审核订货原币金额
  bsaleprice?: string; // 报价含税标识
  bgift?: string; // 赠品标识
  cbdefine1?: number; // 使用促销金额
  cbdefine2?: number; // 业绩金额
  cbdefine3?: string; // 仓库
  cdefine22?: string; // 自定义项22
  cdefine23?: string; // 自定义项23
  cdefine24?: string; // 自定义项24
  cdefine25?: string; // 自定义项25
  cdefine26?: number; // 自定义项26
  cdefine27?: number; // 自定义项27
  cdefine28?: string; // 自定义项28
  cdefine29?: string; // 自定义项29
  cdefine30?: string; // 自定义项30
  cdefine31?: string; // 自定义项31
  cdefine32?: string; // 自定义项32
  cdefine33?: string; // 自定义项33
  cdefine34?: number; // 自定义项34
  cdefine35?: number; // 自定义项35
  cdefine36?: string; // 自定义项36
  cdefine37?: string; // 自定义项37
}

export const soRdsList = (params?: SoRds | any) =>
  defHttp.get<SoRds>({ url: adminPath + '/shop/order/soRds/list', params });

export const soRdsListData = (params?: SoRds | any) =>
  defHttp.post<Page<SoRds>>({ url: adminPath + '/shop/order/soRds/listData', params });

export const soRdsForm = (params?: SoRds | any) =>
  defHttp.get<SoRds>({ url: adminPath + '/shop/order/soRds/form', params });

export const soRdsSave = (params?: any, data?: SoRds | any) =>
  defHttp.postJson<SoRds>({ url: adminPath + '/shop/order/soRds/save', params, data });

export const soRdsDelete = (params?: SoRds | any) =>
  defHttp.get<SoRds>({ url: adminPath + '/shop/order/soRds/delete', params });

// export const stockListData = (params?: SoRds | any) =>
//   defHttp.post<Page<SoRds>>({ url: adminPath + '/shop/inv/stock/listData', params });

export const stockListData = (params?: SoRds | any) =>
  defHttp.post<Page<SoRds>>({ url: adminPath + '/shop/order/soMain/stockListData', params });

export const updateStash = (params?: any, data?: SoRds | any) =>
  defHttp.postJson<SoRds>({ url: adminPath + '/shop/order/soRds/setStash', params, data });

export const deleteRow = (params?: SoRds | any) =>
  defHttp.get<SoRds>({ url: adminPath + '/shop/order/soRds/deleteRow', params });

export const splitRow = (params?: any, data?: SoRds | any) =>
  defHttp.postJson<SoRds>({ url: adminPath + '/shop/order/soRds/splitRow', params, data });

export const editSplitRow = (params?: any, data?: SoRds | any) =>
  defHttp.postJson<SoRds>({ url: adminPath + '/shop/order/soRds/editSplitRow', params, data });

export const addRow = (params?: any, data?: SoRds | any) =>
  defHttp.postJson<SoRds>({ url: adminPath + '/shop/order/soRds/addRow', params, data });

export const initRowEdit = (params?: any, data?: SoRds | any) =>
  defHttp.postJson<SoRds>({ url: adminPath + '/shop/order/soRds/initRowEdit', params, data });

export const rowClose = (params?: SoRds | any) =>
  defHttp.get<SoRds>({ url: adminPath + '/shop/order/soRds/rowClose', params });
